<?php

require_once "misc.php";
require_once "dataLogic/common.php";
require_once "dataLogic/MJDMReward.php";

if(!isset($_SESSION)){session_start();}

log_action("In Page : ".__FILE__);

//check login 
CheckLogin();

ob_start(); // begin collecting output
include 'dataLogic/rewardlist.php';
$rewardList = ob_get_clean();

$uInstance = GetUserBasicInfo();
$earnPoints = $uInstance->getCurPoints();

$rewardContents =<<< EOReawrdContents
<div class="wrapper mt50">
	<div class="nav">
		<ul>
			<li class="tasks">
				<a href="main.php"><span class="nav-item">Tasks</span></a>
			</li>
			<li class="rewards current">
				<span class="nav-item">Rewards</span>
			</li>
		</ul>
	</div>
	<div class="content" id="content">
		<p class="current-coins">You have <span class="coin-number">$earnPoints</span> coins.</p>
		<div id="rewardlist">
			$rewardList
		</div>
		$addRewardContents
		$getRewardContents
		$editRewardContents
		$deleteRewardContents
		<div class="success-message">A new reward was added!</div>
		<input type='hidden' value='0' class='hide_current_id' />
	</div>
</div>
EOReawrdContents;

echo $rewardContents;


?>